<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>题库中心 - 智能学习平台</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap">
    <style>
        :root {
            --primary: #4361ee;
            --primary-light: #4895ef;
            --primary-dark: #3a0ca3;
            --secondary: #7209b7;
            --accent: #f72585;
            --success: #4cc9f0;
            --warning: #f9c74f;
            --danger: #f94144;
            --light: #f8f9fa;
            --dark: #212529;
            --gray: #6c757d;
            --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
            --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', 'Segoe UI', sans-serif;
            background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
            color: var(--dark);
            line-height: 1.6;
            min-height: 100vh;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 15px;
        }

        /* 头部样式 */
        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px;
            background-color: rgba(255, 255, 255, 0.95);
            border-radius: 0 0 20px 20px;
            backdrop-filter: blur(10px);
            box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 1.6rem;
            font-weight: 700;
            color: var(--primary);
            text-decoration: none;
        }

        .logo-icon {
            color: var(--primary);
            font-size: 2rem;
        }

        .nav-links {
            display: flex;
            gap: 30px;
        }

        .nav-link {
            color: var(--dark);
            text-decoration: none;
            font-weight: 500;
            transition: var(--transition);
            position: relative;
        }

        .nav-link:hover {
            color: var(--primary);
        }

        .nav-link::after {
            content: '';
            position: absolute;
            bottom: -5px;
            left: 0;
            width: 0;
            height: 2px;
            background: var(--primary);
            transition: var(--transition);
        }

        .nav-link:hover::after {
            width: 100%;
        }

        .header-buttons {
            display: flex;
            gap: 15px;
        }

        .btn {
            padding: 12px 24px;
            border: none;
            border-radius: 10px;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.95rem;
        }

        .btn-primary {
            background: var(--primary);
            color: white;
            box-shadow: 0 4px 14px rgba(67, 97, 238, 0.4);
        }

        .btn-primary:hover {
            background: var(--primary-dark);
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(67, 97, 238, 0.5);
        }

        .btn-outline {
            background: transparent;
            border: 2px solid var(--primary);
            color: var(--primary);
        }

        .btn-outline:hover {
            background: var(--primary);
            color: white;
            transform: translateY(-2px);
        }

        /* 页面标题 */
        .page-header {
            margin: 40px 0 30px;
            text-align: center;
        }

        .page-title {
            font-size: 2.5rem;
            font-weight: 700;
            margin-bottom: 15px;
            color: var(--dark);
        }

        .page-subtitle {
            font-size: 1.1rem;
            color: var(--gray);
            max-width: 600px;
            margin: 0 auto;
        }

        /* 题库内容 */
        .question-bank {
            display: flex;
            gap: 30px;
            margin-bottom: 60px;
        }

        /* 侧边栏 */
        .sidebar {
            flex: 0 0 280px;
            background: white;
            border-radius: 16px;
            padding: 25px;
            box-shadow: var(--card-shadow);
            height: fit-content;
        }

        .sidebar-section {
            margin-bottom: 25px;
        }

        .sidebar-title {
            font-size: 1.2rem;
            font-weight: 600;
            margin-bottom: 15px;
            color: var(--dark);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .filter-options {
            list-style: none;
        }

        .filter-options li {
            margin-bottom: 12px;
            display: flex;
            align-items: center;
        }

        .filter-options input[type="checkbox"],
        .filter-options input[type="radio"] {
            margin-right: 10px;
            width: 18px;
            height: 18px;
            accent-color: var(--primary);
        }

        .filter-options label {
            cursor: pointer;
            display: flex;
            align-items: center;
            width: 100%;
        }

        .tag-list {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }

        .tag {
            background: rgba(67, 97, 238, 0.1);
            color: var(--primary);
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 0.9rem;
            cursor: pointer;
            transition: var(--transition);
        }

        .tag:hover,
        .tag.active {
            background: var(--primary);
            color: white;
        }

        /* 搜索框 */
        .search-box {
            position: relative;
            margin-bottom: 25px;
        }

        .search-input {
            width: 100%;
            padding: 14px 20px 14px 45px;
            border: 2px solid #e2e8f0;
            border-radius: 12px;
            font-size: 1rem;
            transition: var(--transition);
        }

        .search-input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
        }

        .search-icon {
            position: absolute;
            left: 15px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--gray);
        }

        /* 主内容区 */
        .main-content {
            flex: 1;
        }

        .content-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 25px;
        }

        .results-count {
            font-weight: 500;
            color: var(--gray);
        }

        .sort-select {
            padding: 10px 15px;
            border: 2px solid #e2e8f0;
            border-radius: 10px;
            background: white;
            font-size: 0.95rem;
            cursor: pointer;
        }

        /* 题目列表 */
        .questions-list {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .question-card {
            background: white;
            border-radius: 16px;
            padding: 25px;
            box-shadow: var(--card-shadow);
            transition: var(--transition);
            position: relative;
        }

        .question-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
        }

        .question-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 15px;
        }

        .question-title {
            font-size: 1.2rem;
            font-weight: 600;
            color: var(--dark);
            margin-right: 15px;
        }

        .question-meta {
            display: flex;
            gap: 15px;
            margin-bottom: 15px;
            flex-wrap: wrap;
        }

        .meta-item {
            display: flex;
            align-items: center;
            gap: 5px;
            font-size: 0.9rem;
            color: var(--gray);
        }

        .question-content {
            margin-bottom: 20px;
            line-height: 1.7;
        }

        .question-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .question-tags {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }

        .question-tag {
            background: rgba(67, 97, 238, 0.1);
            color: var(--primary);
            padding: 4px 10px;
            border-radius: 12px;
            font-size: 0.8rem;
        }

        .difficulty {
            font-weight: 600;
            padding: 4px 12px;
            border-radius: 12px;
            font-size: 0.85rem;
        }

        .difficulty.easy {
            background: rgba(76, 201, 240, 0.2);
            color: #4cc9f0;
        }

        .difficulty.medium {
            background: rgba(249, 199, 79, 0.2);
            color: #f9c74f;
        }

        .difficulty.hard {
            background: rgba(249, 65, 68, 0.2);
            color: #f94144;
        }

        /* 分页 */
        .pagination {
            display: flex;
            justify-content: center;
            gap: 10px;
            margin-top: 40px;
        }

        .page-btn {
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 10px;
            border: 2px solid #e2e8f0;
            background: white;
            color: var(--dark);
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
        }

        .page-btn:hover,
        .page-btn.active {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
        }

        /* 响应式设计 */
        @media (max-width: 992px) {
            .question-bank {
                flex-direction: column;
            }

            .sidebar {
                flex: 1;
                width: 100%;
            }
        }

        @media (max-width: 768px) {
            .header {
                flex-direction: column;
                gap: 20px;
                padding: 15px;
            }

            .nav-links {
                flex-wrap: wrap;
                justify-content: center;
            }

            .page-title {
                font-size: 2rem;
            }

            .question-header {
                flex-direction: column;
                gap: 10px;
            }

            .question-footer {
                flex-direction: column;
                align-items: flex-start;
                gap: 15px;
            }
        }

        @media (max-width: 576px) {
            .header-buttons {
                flex-direction: column;
                width: 100%;
            }

            .btn {
                width: 100%;
                justify-content: center;
            }

            .content-header {
                flex-direction: column;
                gap: 15px;
                align-items: flex-start;
            }

            .sort-select {
                width: 100%;
            }
        }
    </style>
</head>

<body>
    <div class="container">
        <!-- 头部 -->
        <div class="header">
            <a href="index_2.html" class="logo">
                <i class="fas fa-brain logo-icon"></i>
                <span>智学平台</span>
            </a>

            <div class="nav-links">
                <a href="index_2.html" class="nav-link">首页</a>
                <a href="#" class="nav-link">课程</a>
                <a href="#" class="nav-link active">题库</a>
                <a href="#" class="nav-link">考试</a>
                <a href="#" class="nav-link">学习路径</a>
                <a href="#" class="nav-link">关于我们</a>
            </div>

            <div class="header-buttons">
                <button class="btn btn-outline">
                    <i class="fas fa-user"></i>
                    <span>登录</span>
                </button>
                <button class="btn btn-primary">
                    <i class="fas fa-user-plus"></i>
                    <span>注册</span>
                </button>
            </div>
        </div>

        <!-- 页面标题 -->
        <div class="page-header">
            <h1 class="page-title">嵌入式与物联网题库</h1>
            <p class="page-subtitle">精选高质量题目，涵盖嵌入式开发、物联网应用的各个知识点，助力巩固学习成果</p>
        </div>

        <!-- 题库内容 -->
        <div class="question-bank">
            <!-- 侧边栏 -->
            <div class="sidebar">
                <div class="search-box">
                    <i class="fas fa-search search-icon"></i>
                    <input type="text" class="search-input" placeholder="搜索题目或知识点...">
                </div>

                <div class="sidebar-section">
                    <h3 class="sidebar-title"><i class="fas fa-layer-group"></i> 题目分类</h3>
                    <ul class="filter-options">
                        <li>
                            <input type="radio" id="category-all" name="category" checked>
                            <label for="category-all">全部题目</label>
                        </li>
                        <li>
                            <input type="radio" id="category-c" name="category">
                            <label for="category-c">C语言编程</label>
                        </li>
                        <li>
                            <input type="radio" id="category-mcu" name="category">
                            <label for="category-mcu">单片机开发</label>
                        </li>
                        <li>
                            <input type="radio" id="category-rtos" name="category">
                            <label for="category-rtos">实时操作系统</label>
                        </li>
                        <li>
                            <input type="radio" id="category-iot" name="category">
                            <label for="category-iot">物联网应用</label>
                        </li>
                        <li>
                            <input type="radio" id="category-circuit" name="category">
                            <label for="category-circuit">电路设计</label>
                        </li>
                    </ul>
                </div>

                <div class="sidebar-section">
                    <h3 class="sidebar-title"><i class="fas fa-signal"></i> 难度级别</h3>
                    <ul class="filter-options">
                        <li>
                            <input type="checkbox" id="difficulty-all" checked>
                            <label for="difficulty-all">全部难度</label>
                        </li>
                        <li>
                            <input type="checkbox" id="difficulty-easy">
                            <label for="difficulty-easy">初级</label>
                        </li>
                        <li>
                            <input type="checkbox" id="difficulty-medium">
                            <label for="difficulty-medium">中级</label>
                        </li>
                        <li>
                            <input type="checkbox" id="difficulty-hard">
                            <label for="difficulty-hard">高级</label>
                        </li>
                    </ul>
                </div>

                <div class="sidebar-section">
                    <h3 class="sidebar-title"><i class="fas fa-tag"></i> 热门标签</h3>
                    <div class="tag-list">
                        <span class="tag active">全部</span>
                        <span class="tag">数据结构</span>
                        <span class="tag">指针</span>
                        <span class="tag">STM32</span>
                        <span class="tag">FreeRTOS</span>
                        <span class="tag">传感器</span>
                        <span class="tag">通信协议</span>
                        <span class="tag">驱动开发</span>
                    </div>
                </div>

                <button class="btn btn-primary" style="width: 100%;">
                    <i class="fas fa-filter"></i>
                    <span>应用筛选</span>
                </button>
            </div>

            <!-- 主内容区 -->
            <div class="main-content">
                <div class="content-header">
                    <div class="results-count">显示 128 道题目</div>
                    <select class="sort-select">
                        <option>最新优先</option>
                        <option>最热优先</option>
                        <option>难度从低到高</option>
                        <option>难度从高到低</option>
                    </select>
                </div>

                <div class="questions-list">
                    <!-- 题目1 -->
                    <div class="question-card">
                        <div class="question-header">
                            <h3 class="question-title">C语言中指针和数组的区别与联系</h3>
                            <span class="difficulty medium">中等</span>
                        </div>
                        <div class="question-meta">
                            <span class="meta-item"><i class="far fa-calendar-alt"></i> 2023-11-15</span>
                            <span class="meta-item"><i class="far fa-eye"></i> 1245</span>
                            <span class="meta-item"><i class="far fa-star"></i> 4.8</span>
                        </div>
                        <div class="question-content">
                            请详细说明C语言中指针和数组的区别与联系，并举例说明在什么情况下数组名可以当作指针使用，什么情况下不能。
                        </div>
                        <div class="question-footer">
                            <div class="question-tags">
                                <span class="question-tag">C语言</span>
                                <span class="question-tag">指针</span>
                                <span class="question-tag">数组</span>
                            </div>
                            <button class="btn btn-outline">查看解析</button>
                        </div>
                    </div>

                    <!-- 题目2 -->
                    <div class="question-card">
                        <div class="question-header">
                            <h3 class="question-title">STM32中断优先级分组配置</h3>
                            <span class="difficulty hard">困难</span>
                        </div>
                        <div class="question-meta">
                            <span class="meta-item"><i class="far fa-calendar-alt"></i> 2023-11-10</span>
                            <span class="meta-item"><i class="far fa-eye"></i> 892</span>
                            <span class="meta-item"><i class="far fa-star"></i> 4.9</span>
                        </div>
                        <div class="question-content">
                            在STM32开发中，如何配置中断优先级分组？请说明NVIC_PriorityGroupConfig函数的使用方法，以及抢占优先级和子优先级的区别和作用。
                        </div>
                        <div class="question-footer">
                            <div class="question-tags">
                                <span class="question-tag">STM32</span>
                                <span class="question-tag">中断</span>
                                <span class="question-tag">嵌入式</span>
                            </div>
                            <button class="btn btn-outline">查看解析</button>
                        </div>
                    </div>

                    <!-- 题目3 -->
                    <div class="question-card">
                        <div class="question-header">
                            <h3 class="question-title">FreeRTOS任务调度机制</h3>
                            <span class="difficulty medium">中等</span>
                        </div>
                        <div class="question-meta">
                            <span class="meta-item"><i class="far fa-calendar-alt"></i> 2023-11-05</span>
                            <span class="meta-item"><i class="far fa-eye"></i> 756</span>
                            <span class="meta-item"><i class="far fa-star"></i> 4.7</span>
                        </div>
                        <div class="question-content">
                            请详细解释FreeRTOS的任务调度机制，包括就绪列表、时间片轮转和优先级抢占的工作原理。并说明如何创建和管理任务。
                        </div>
                        <div class="question-footer">
                            <div class="question-tags">
                                <span class="question-tag">FreeRTOS</span>
                                <span class="question-tag">实时系统</span>
                                <span class="question-tag">任务调度</span>
                            </div>
                            <button class="btn btn-outline">查看解析</button>
                        </div>
                    </div>

                    <!-- 题目4 -->
                    <div class="question-card">
                        <div class="question-header">
                            <h3 class="question-title">I2C通信协议原理与实现</h3>
                            <span class="difficulty easy">简单</span>
                        </div>
                        <div class="question-meta">
                            <span class="meta-item"><i class="far fa-calendar-alt"></i> 2023-10-28</span>
                            <span class="meta-item"><i class="far fa-eye"></i> 1024</span>
                            <span class="meta-item"><i class="far fa-star"></i> 4.6</span>
                        </div>
                        <div class="question-content">
                            请描述I2C通信协议的基本原理，包括起始信号、停止信号、数据传输和应答机制。并说明如何在STM32上实现I2C通信。
                        </div>
                        <div class="question-footer">
                            <div class="question-tags">
                                <span class="question-tag">通信协议</span>
                                <span class="question-tag">I2C</span>
                                <span class="question-tag">嵌入式</span>
                            </div>
                            <button class="btn btn-outline">查看解析</button>
                        </div>
                    </div>

                    <!-- 题目5 -->
                    <div class="question-card">
                        <div class="question-header">
                            <h3 class="question-title">嵌入式系统中看门狗的作用与实现</h3>
                            <span class="difficulty medium">中等</span>
                        </div>
                        <div class="question-meta">
                            <span class="meta-item"><i class="far fa-calendar-alt"></i> 2023-10-20</span>
                            <span class="meta-item"><i class="far fa-eye"></i> 876</span>
                            <span class="meta-item"><i class="far fa-star"></i> 4.8</span>
                        </div>
                        <div class="question-content">
                            看门狗在嵌入式系统中的作用是什么？请说明独立看门狗(IWDG)和窗口看门狗(WWDG)的区别，以及如何在STM32中配置和使用看门狗。
                        </div>
                        <div class="question-footer">
                            <div class="question-tags">
                                <span class="question-tag">嵌入式</span>
                                <span class="question-tag">看门狗</span>
                                <span class="question-tag">系统安全</span>
                            </div>
                            <button class="btn btn-outline">查看解析</button>
                        </div>
                    </div>
                </div>

                <!-- 分页 -->
                <div class="pagination">
                    <button class="page-btn"><i class="fas fa-chevron-left"></i></button>
                    <button class="page-btn active">1</button>
                    <button class="page-btn">2</button>
                    <button class="page-btn">3</button>
                    <button class="page-btn">4</button>
                    <button class="page-btn">5</button>
                    <button class="page-btn"><i class="fas fa-chevron-right"></i></button>
                </div>
            </div>
        </div>
    </div>

    <script>
        // 简单的交互效果
        document.querySelectorAll('.btn').forEach(button => {
            button.addEventListener('click', function () {
                this.style.transform = 'scale(0.98)';
                setTimeout(() => {
                    this.style.transform = '';
                }, 150);
            });
        });

        // 标签选择效果
        document.querySelectorAll('.tag').forEach(tag => {
            tag.addEventListener('click', function () {
                if (this.textContent === '全部') {
                    // 如果点击的是"全部"，取消其他标签的选中状态
                    document.querySelectorAll('.tag').forEach(t => {
                        if (t !== this) t.classList.remove('active');
                    });
                    this.classList.add('active');
                } else {
                    // 如果点击其他标签，取消"全部"的选中状态
                    document.querySelector('.tag:first-child').classList.remove('active');
                    this.classList.toggle('active');
                }
            });
        });

        // 搜索功能
        const searchInput = document.querySelector('.search-input');
        searchInput.addEventListener('keyup', function (event) {
            if (event.key === 'Enter') {
                performSearch(this.value);
            }
        });

        function performSearch(query) {
            if (query.trim() === '') return;

            // 在实际应用中，这里会发送请求到服务器进行搜索
            console.log('搜索:', query);
            alert(`搜索: ${query}`);
            // 模拟搜索结果显示
            document.querySelector('.results-count').textContent = `显示 5 道关于 "${query}" 的题目`;
        }
    </script>
</body>

</html>